package cn.com.dcsgo.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

/**
 * 响应状态码
 *
 * @author Dcsgo
 * @since 2025/3/6 12:03
 */
@Getter
@AllArgsConstructor
public enum ResponseStatus {
    /**
     * 请求成功
     */
    SUCCESS("200", "请求成功"),
    /**
     * 请求错误
     */
    FAIL("400", "请求错误"),

    HTTP_STATUS_200("200", "请求成功"),
    HTTP_STATUS_400("400", "请求错误"),
    HTTP_STATUS_401("401", "未授权访问"),
    HTTP_STATUS_403("403", "禁止访问"),
    HTTP_STATUS_500("500", "服务器异常");

    public static final List<ResponseStatus> HTTP_STATUS_ALL;

    static {
        HTTP_STATUS_ALL = new ArrayList<>();
        HTTP_STATUS_ALL.add(HTTP_STATUS_200);
        HTTP_STATUS_ALL.add(HTTP_STATUS_400);
        HTTP_STATUS_ALL.add(HTTP_STATUS_401);
        HTTP_STATUS_ALL.add(HTTP_STATUS_403);
        HTTP_STATUS_ALL.add(HTTP_STATUS_500);
    }

    /**
     * 状态码
     */
    private final String responseCode;

    /**
     * 状态码说明
     */
    private final String description;
}
